package base.day12;

import java.util.ArrayList;

public class List {
    public static void main(String[] args) {
        ArrayList<Student> al=new ArrayList();
        Student stu1=new Student("张三",23);
        Student stu2=new Student("李四",24);
        Student stu3=new Student("王五",25);
        al.add(stu1);
        al.add(stu2);
        al.add(stu3);
        for (int i = 0; i < al.size(); i++) {
            Student temp=al.get(i);
            System.out.println(temp.getName()+","+temp.getAge());
        }
    }
}
